package pt.ist.meic.pava;

import javassist.CtMethod;
 



/**
 * 
 * @author Antonio Massingue
 * @author Joao Matos
 * @author Nuno Santos
 * 
 * This Exception should be thrown when a 
 * method declared in the trait interface 
 * is not present in the trait implementation
 * 
 */
public class TraitMethodNotImplementedException extends Exception {

	
	
	
	/**
	 * The Serial Version UId
	 */
	private static final long serialVersionUID = 1L;

	/**
	 * The method not implemented
	 */
	private CtMethod aCtMethod;
	
	
	
	
	
	
	
	
	/**
	 * Default constructor
	 */
	public TraitMethodNotImplementedException() {
		super();
	}
	
	/**
	 * Overloaded constructor
	 * @param ctm	The method not implemented
	 */
	public TraitMethodNotImplementedException(CtMethod ctm) {
		super();
		this.aCtMethod = ctm;
	}

	
	
	
	
	
	
	
	/**
	 * 
	 * The exception message
	 */
	public String getTraitMessage() {
		return "The trait doesn't implement some methods of the declared interfaces";
	}
	/**
	 * The detailed exception message
	 */
	public String getTraitMethodDetailedExceptionMessage() {
		return "[TraitMethodNotImplementedException] The trait doesn't implement the method "+this.aCtMethod.getName()+" of the declared interfaces";
	}
	
	
	
	
	
	
	
	
	
	/**
	 * @return The method not implemented
	 */
	public CtMethod getaCtMethod() {
		return aCtMethod;
	}

	/**
	 * 
	 * @param aCtMethod		The method not implemented
	 */
	public void setaCtMethod(CtMethod aCtMethod) {
		this.aCtMethod = aCtMethod;
	}
	
	
	
	
	

}
